<?php

namespace App\Helpers;

use Psr\Http\Message\ResponseInterface as Response;

class UrlHelper
{
    public static function redirectUrl(Response $response, string $url = '')
    {
        if ($url == '') {
            $url = $_ENV['app_host'];
        }
        return $response->withHeader('Location', $url)->withStatus(302);
    }
}
